<%@ page pageEncoding="UTF-8" contentType="text/html;charset=utf-8"%>
<%@ taglib uri="http://www.springframework.org/security/tags"
	prefix="security"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@ taglib uri="http://www.joda.org/joda/time/tags" prefix="joda"%>

<security:authorize
	ifAnyGranted="ROLE_SUPERVISOR,ROLE_33H46GZ4GDWDKQ50DWU5">
	<div id="depts" class="btn-group"></div>
	<div class="input-append input-prepend">
		<span class="add-one"><i class="icon-calendar"></i></span> <input
			type="text" id="datepicker" name="bean.createDate" class="datepicker"
			readOnly />
		<button type="button" class="btn btn-primary" id="compbtn">综合日报</button>
	</div>
</security:authorize>
<table class="table table-bordered table-hover">
	<thead>
		<tr>
			<th>标题</th>
			<th width="150">制作者</th>
			<th width="150">部门</th>
			<th width="200">创建日期</th>
			<th width="200">修改日期</th>
			<th>管理</th>
		</tr>
	</thead>
	<tbody>
		<c:forEach items="${pager.rows}" var="item">
			<tr class="info">
				<td>
					<button class="btn btn-small btn-inverse"
						onclick="showOne('${item.id}');">
						<i class="icon-lock"></i>查看
					</button>
				</td>
				<td>${item.maker.username}[${item.maker.localName}]</td>
				<td>${item.department.name}</td>
				<td>
				<joda:format  value="${item.createDate}"
						pattern="yyyy-MM-dd HH:mm:ss" /></td>
				<td><joda:format  value="${item.updateDate}"
						pattern="yyyy-MM-dd HH:mm:ss" /></td>
			    <td>
			    <c:choose>
			       <c:when test="${item.finished}">
			    	 <button class="btn btn-small btn-primary"
						onclick="submitfor('${item.id}',false);">
						<i class="icon-share"></i>解锁
					 </button>
			       </c:when>
			       <c:otherwise>
			            <i class="icon-lock"></i>
			       </c:otherwise>
			    </c:choose>
			    
			    </td>
			    
			</tr>
		</c:forEach>
	</tbody>
	<tfoot>
		<tr>
			<td colspan="4">${pager.pagination}</td>
		</tr>
	</tfoot>
</table>

<script src="scripts/apps/reporter/list.js" type="text/javascript"></script>
<script src="scripts/apps/reporter/util.js" type="text/javascript"></script>
<script src="scripts/apps/reporter/daily/submited.js" type="text/javascript"></script>